class SysModel {
  final String? version;
  final String? updateUrl;
  final String? notice;
  final PlayBanner? playbanner;
  final List<String>? userImg;

  SysModel({
    this.version,
    this.updateUrl,
    this.notice,
    this.playbanner,
    this.userImg,
  });

  factory SysModel.fromJson(Map<String, dynamic>? json) {
    if (json == null) return SysModel();

    return SysModel(
      version: json['version']?.toString(),
      updateUrl: json['updateUrl']?.toString(),
      notice: json['notice']?.toString(),
      playbanner: PlayBanner.fromJson(json['playbanner'] as Map<String, dynamic>?),
      userImg: (json['userImg'] as List<dynamic>?)?.cast<String>(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'version': version,
      'updateUrl': updateUrl,
      'notice': notice,
      'playbanner': playbanner?.toJson(),
      'userImg': userImg,
    };
  }
}

class PlayBanner {
  final bool? show;
  final String? src;
  final String? href;

  PlayBanner({
    this.show,
    this.src,
    this.href,
  });

  factory PlayBanner.fromJson(Map<String, dynamic>? json) {
    if (json == null) return PlayBanner();

    return PlayBanner(
      show: json['show'] as bool?,
      src: json['src']?.toString(),
      href: json['href']?.toString(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'show': show,
      'src': src,
      'href': href,
    };
  }
}
